#!python
import os

env = Environment()

if ARGUMENTS.get("use_llvm", "no") == "yes":
    env["CXX"] = "clang++"


platform = ARGUMENTS.get("p", "linux")


def add_sources(sources, dir):
    for f in os.listdir(dir):
        if f.endswith(".cpp"):
            sources.append(dir + "/" + f)

if platform == "linux":
    env.Append(CCFLAGS = ['-g','-O3', '-std=c++14', '-Wno-writable-strings'])
    env.Append(LINKFLAGS = ['-Wl,-R,\'$$ORIGIN\''])

env.Append(CPPPATH=['/usr/include/godot/', '/usr/include/godot/godot_cpp/', '/usr/include/godot/godot_cpp/core'])

env.Append(LIBS=['godot_cpp_core', 'godot_cpp_bindings'])
env.Append(LIBPATH=["../lib"])

if platform == "windows":
    env.Append(LIBS=['godot.windows.tools.64']) 

sources = ["init.cpp"]



library = env.SharedLibrary(target='../lib/test', source=sources)
Default(library)

